import React from "react";
import NavBar from "../../components/NavBar";
import CurentCity from "./CurentCity";
import CityList from "./CurentList";
import { useSelector } from "react-redux";
import CityLists from "./CityLists";
import CityListsData from "../../data/city.json";
import useCity from "../../hooks/useCityHooks";


const City = () => {
    const cityStore = useSelector(state => state.city)
    const { onCityEvent } = useCity()
    return (
        <>
            <NavBar title="选择城市"></NavBar>
            <CurentCity city={cityStore.cityName} />
            <CityList onCityEvent={onCityEvent} />
            <CityLists data={CityListsData.result} />
        </>
    )
}

export default City